{
    interface UserObj {
        name: string
        age: number
        sex?: boolean
    }
    let setInfo = (userInfo: UserObj): void => {
        console.log(userInfo.name, userInfo.age);
    }
    let obj: UserObj = { name: '张三', age: 123 }
    setInfo(obj)
    let obj1: UserObj = { name: '张三', age: 123, sex: true }
    setInfo(obj1)
}
